import Vue from 'vue'
import VueRouter from 'vue-router'

const login = () =>import('pages/login/login')
const index = () =>import('pages/index/index')
const upload = () =>import('pages/upload/upload')
const message = () =>import('pages/message/message')
const disease = () =>import('pages/disease/disease')
const diseaseDetail = () =>import('pages/diseaseDetail/diseaseDetail')
const person = () =>import('pages/person/person')
const postArtical = () =>import('pages/person/postArtical/postArtical')
const personInfo = () =>import('pages/person/personInfo/personInfo')
const postVideo = () =>import('pages/person/postVideo/postVideo')
const liveSet = () =>import('pages/person/liveSet/liveSet')
const artical = () =>import('pages/artical/artical')
const live = () =>import('pages/live/live')

const chat = () =>import('pages/chat')

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: '/index'
  }, 
  {
    path:'/login',
    component:login,
  },
  {
    path:'/index',
    component:index,
  },
  {
    path:'/upload',
    component:upload,
  },
  {
    path:'/message',
    component:message,
  },
  {
    path:'/disease',
    component:disease,
  },
  {
    path:'/diseaseDetail',
    component:diseaseDetail,
  },
  {
    path:'/person',
    component:person,
    children:[
      {
        path:'/personInfo',
        component:personInfo,
      },
      {
        path:'/postArtical',
        component:postArtical,
      },
      {
        path:'/postVideo',
        component:postVideo,
      },
      {
        path:'/liveSet',
        component:liveSet,
      },
    ]
  },
  {
    path:'/chat',
    component:chat,
  },
  {
    path:'/artical',
    component:artical,
  },
  {
    path:'/live',
    component:live,
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
